<?php

use think\Cache;
use think\migration\Seeder;

class AddSealMenu extends Seeder
{
    /**
     * Run Method.
     *
     * Write your database seeder using this method.
     *
     * More information on writing seeders is available here:
     * http://docs.phinx.org/en/latest/seeding.html
     */
    public function run()
    {
        $rows = [
            ['id' => 59, 'icon' => "fa-hdd-o", "name" => "印章管理", "url" => "/admin/seal/index", "pid" => 2, "sort" => 1, "level" => 2, "status" => 1, "is_show" => 1, "update_time" => time(), 'create_time' => time()],
            ['id' => 60, 'icon' => "fa-hdd-o", "name" => "印章查询", "url" => "/admin/seal/index", "pid" => 59, "sort" => 1, "level" => 2, "status" => 1, "is_show" => 1, "update_time" => time(), 'create_time' => time()],
            ['id' => 61, 'icon' => "fa-hdd-o", "name" => "流程管理", "url" => "/admin/approval/index", "pid" => 59, "sort" => 2, "level" => 2, "status" => 1, "is_show" => 1, "update_time" => time(), 'create_time' => time()],
            ['id' => 62, 'icon' => "fa-hdd-o", "name" => "印章报警查询", "url" => "/admin/position/index", "pid" => 59, "sort" => 3, "level" => 2, "status" => 1, "is_show" => 1, "update_time" => time(), 'create_time' => time()],
        ];

        $this->table("menu")->insert($rows)->save();
        Cache::clear();
    }
}